package com.itheima.project_cloth.service.impl;

import com.itheima.project_cloth.mapper.ConsumerMapper;
import com.itheima.project_cloth.pojo.Consumer;
import com.itheima.project_cloth.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsumerServiceImpl implements ConsumerService {
    @Autowired
    private ConsumerMapper consumerMapper;

    @Override
    public List<Consumer> SelectConsumerByVip(Integer vipStatus) {


        return consumerMapper.list(vipStatus);
    }

    @Override
    public void insert(Consumer consumer) {
        consumerMapper.insert(consumer);
    }

    @Override
    public void delete(Integer id) {
        consumerMapper.delete(id);
    }

    @Override
    public Consumer select(String name) {
        Consumer con = consumerMapper.select(name);
        return con;
    }

    @Override
    public List<Consumer> selectVip(Integer status) {
        List<Consumer> consumers = consumerMapper.selectVip(status);
        return consumers;
    }

    @Override
    public void deleteIds(List<Integer> ids) {
        consumerMapper.deleteIds(ids);
    }

    @Override
    public void UpdateConsumerById(Consumer consumer) {
        consumerMapper.UpdateConsumerById(consumer);
    }
}
